const net = require('net')
const fs = require('fs')

let client = net.createConnection({
    host: 'localhost',
    port: 8000
}, () => {
    // 信息传输
    // client.end('client -> server')

    let rs = fs.createReadStream('./七层模型.jpg')
    rs.pipe(client)
})

client.on('data', (data) => {
    console.log(data)
})
client.on('error', (err) => {
    console.log(err)
})